<template name="myShopOrderList"> 
	<view class="myOrderListAre">
		<view class="display column calc myOrderList borderR" v-for="(item,index) in orderList" :key="index" v-if="type=='order'">
			<view class="calc orderAre">
				<view class="display flow titleAre">
					<view class="display flow titleItemAre">
						<image src="/static/images/icon/shopIcon.png"></image>
						<text class="shopName">{{item.shop_name}}</text>
						<uni-icons :type="'arrowright'" :color="'grey'" size="16" />
					</view>
					<text class="themeColor">{{item.statusText}}</text>
				</view>
				<view class="display flow orderItemAre" v-for="(cell,idx) in item.content" :key="idx" @click="orderClick(item.id)">
					<image :src="cell.head_img" class="shopImg"></image>
					<view class="display display_1 column orderItemBoxAre">
						<view class="display flow orderItemBox">
							<view class="display column orderItem" style="width: 80%;">
								<text class="fontHide">{{cell.product_name}}</text>
								<text class="pColor fontHide" v-if="cell.unit">单位： {{cell.unit}}</text>
							</view>
							<view class="display column orderItem" style="align-items: flex-end;">
								<text>￥{{cell.price}}</text>
								<text class="pColor">x{{cell.num}}</text>
							</view>
						</view>
						<view class="display flow refundTipAre" v-if="item.status == 5 || item.status == 7 || item.tk_status == 1">
							<text class="goldenColor">{{cell.statusText}}</text>
							<text class="goldenColor" v-if="cell.tkTime" style="margin-left: 10rpx;">{{cell.tkTime}}</text>
						</view>
					</view>
				</view>
				<view class="display flow mainAre">
					<view class="display column">
						<text>合计：<text class="price">￥{{item.all_price}}</text></text>
					</view>
					<text class="goldenColor" v-if="item.tell_status==1">已评论</text>
					<text class="goldenColor" v-if="item.tk_status == 1">已退款</text>
					<orderBtnAre :orderList="item" :isClose="item.isClose" @deleBtn="deleBtn" @payOk="payOk" :shopType="shopType"></orderBtnAre>
				</view>
			</view>
		</view>
		<view class="display column calc myOrderList" v-if="type=='orderDetails'">
			<view class="calc orderAre">
				<view class="display flow titleAre">
					<view class="display flow titleItemAre">
						<image src="/static/images/icon/shopIcon.png"></image>
						<text class="shopName">{{orderList.shop_name}}</text>
						<uni-icons :type="'arrowright'" :color="'grey'" size="16" />
					</view>
				</view>
				<view class="display flow orderItemAre" v-for="(item,idx) in orderList.content" :key="idx" @click="goodsClick(item.product_id)">
					<image :src="item.head_img" class="shopImg" ></image>
					<view class="display display_1 column orderItemBoxAre">
						<view class="display flow orderItemBox">
							<view class="display column orderItem" style="width: 80%;">
								<text class="fontHide">{{item.product_name}}</text>
								<text class="pColor fontHide" v-if="item.unit">单位： {{item.unit}}</text>
							</view>
							<view class="display column orderItem" style="align-items: flex-end;">
								<text>￥{{item.price}}</text>
								<text class="pColor">x{{item.num}}</text>
							</view>
						</view>
						<view class="display flow refundTipAre"  v-if="orderList.status == 5 || orderList.status == 7 || orderList.tk_status == 1">
							<text class="goldenColor">{{item.statusText}}</text>
							<text class="goldenColor" v-if="item.tkTime" style="margin-left: 10rpx;">{{item.tkTime}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="display column calc myOrderList" v-if="type=='orderDetails2'">
			<view class="calc orderAre">
				<view class="display flow titleAre">
					<view class="display flow titleItemAre" @click="shopClick(orderList.supplier_id)">
						<image src="/static/images/icon/shopIcon.png"></image>
						<text class="shopName">{{orderList.supplier_name}}</text>
						<uni-icons :type="'arrowright'" :color="'grey'" size="16" />
					</view>
				</view>
				<view class="display flow orderItemAre" v-for="(item,idx) in orderList.content" :key="idx" @click="goodsClick(item.product_id)">
					<image :src="item.head_img" class="shopImg" ></image>
					<view class="display display_1 column orderItemBoxAre">
						<view class="display flow orderItemBox">
							<view class="display column orderItem" style="width: 80%;">
								<text class="fontHide">{{item.product_name}}</text>
								<text class="pColor fontHide">{{item.attr_list.properties}}</text>
							</view>
							<view class="display column orderItem" style="align-items: flex-end;">
								<text>￥{{item.attr_price}}</text>
								<text class="pColor">x{{item.num}}</text>
							</view>
						</view>
						<view class="display flow refundTipAre"  v-if="orderList.status == 5 || orderList.status == 7 || orderList.tk_status == 1">
							<text class="goldenColor">{{item.statusText}}</text>
							<text class="goldenColor" v-if="item.tkTime" style="margin-left: 10rpx;">{{item.tkTime}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="display column calc myOrderList borderR" v-for="(item,index) in orderList" :key="index" v-if="type=='shopOrder'">
			<view class="calc orderAre">
				<view class="display flow orderItemAre" v-for="(cell,idx) in item.content" :key="idx" @click="orderClick(item.id)">
					<image :src="cell.head_img" class="shopImg"></image>
					<view class="display display_1 column orderItemBoxAre">
						<view class="display flow orderItemBox">
							<view class="display column orderItem" style="width: 80%;">
								<text class="fontHide">{{cell.product_name}}</text>
								<text class="pColor fontHide" v-if="cell.unit">单位： {{cell.unit}}</text>
							</view>
							<view class="display column orderItem" style="align-items: flex-end;">
								<text>￥{{cell.price}}</text>
								<text class="pColor">x{{cell.num}}</text>
							</view>
						</view>
						<view class="display flow refundTipAre" v-if="item.status == 5 || item.status == 7 || item.tk_status == 1">
							<text class="goldenColor">{{cell.statusText}}</text>
							<text class="goldenColor" v-if="cell.tkTime" style="margin-left: 10rpx;">{{cell.tkTime}}</text>
						</view>
					</view>
				</view>
				<view class="display flow mainAre">
					<view class="display column">
						<text>合计：<text class="price">￥{{item.all_price}}</text></text>
					</view>
					<text class="themeColor">{{item.statusText}}  <text class="goldenColor" v-if="item.tell_status==1">已评论</text><text class="goldenColor" v-if="item.tk_status == 1">已退款</text> </text>
					<orderBtnAre @deliveryOk="deliveryOk" :isShopOrder="isShopOrder" :orderList="item" :shopType="shopType"></orderBtnAre>
				</view>
			</view>
		</view>
		<view class="display column calc myOrderList borderR" v-for="(item,index) in orderList" :key="index" v-if="type=='shopOrder2'">
			<view class="calc orderAre">
				<view class="display flow titleAre">
					<view class="display flow titleItemAre" @click="shopClick(item.supplier_id)">
						<image src="/static/images/icon/shopIcon.png"></image>
						<text class="shopName">{{item.supplier_name}}</text>
						<uni-icons :type="'arrowright'" :color="'grey'" size="16" />
					</view>
					<text class="themeColor">{{item.statusText}}</text>
				</view>
				<view class="display flow orderItemAre" v-for="(cell,idx) in item.content" :key="idx" @click="orderClick(item.id)">
					<image :src="cell.head_img" class="shopImg" ></image>
					<view class="display display_1 column orderItemBoxAre">
						<view class="display flow orderItemBox">
							<view class="display column orderItem" style="width: 80%;">
								<text class="fontHide">{{cell.product_name}}</text>
								<text class="pColor fontHide">{{cell.attr_list.properties}}</text>
							</view>
							<view class="display column orderItem" style="align-items: flex-end;">
								<text>￥{{cell.attr_price}}</text>
								<text class="pColor">x{{cell.num}}</text>
							</view>
						</view>
						<view class="display flow refundTipAre" v-if="item.status == 5 || item.status == 7 || item.tk_status == 1">
							<text class="goldenColor">{{cell.statusText}}</text>
							<text class="goldenColor" v-if="cell.tkTime" style="margin-left: 10rpx;">{{cell.tkTime}}</text>
						</view>
					</view>
				</view>
				<view class="display flow mainAre">
					<view class="display column">
						<block v-if="item.is_card==1">
							<text>合计：<text class="price">￥{{item.realPrice}}</text><text class="pColor" style="text-decoration: line-through;">￥{{item.price}}</text></text>
						</block>
						<block v-else>
							<text>合计：<text class="price">￥{{item.price}}</text></text>
						</block>
					</view>
					<text class="goldenColor" v-if="item.tell_status==1">已评论</text>
					<text class="goldenColor" v-if="item.tk_status == 1">已退款</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import util from '@/common/util.js'
	import orderBtnAre from '@/components/orderBtnAre.vue'
	export default {
		name: "myShopOrderList",
		components: {orderBtnAre},
		props: ['orderList','type','shopType','isShopOrder'],
		data() {
			return {
				
			};
		},
		methods:{
			shopClick(id){
				uni.navigateTo({
					url: '/subPackages/goods/shopAre/shopAre?shopId=' + id
				})
			},
			goodsClick(id){
				let data = {
					id: id,
					disType: this.shopType,
					shopId: this.shopType==0?this.orderList.fx_user_shop_id:this.orderList.user_shop_id
				}
				uni.navigateTo({
					url: '/subPackages/shop/goodsDetails/goodsDetails?list=' + encodeURIComponent(JSON.stringify(data))
				})
			},
			orderClick(id){
				console.log(id)
				if(this.type == 'shopOrder2'){
					uni.navigateTo({
						url: '/subPackages/mine/orderDetails/orderDetails?orderId=' + id + '&shopType=' + this.shopType + '&isShop=' + true 
					})
				}else{
					// console.log(this.isShopOrder);
					uni.navigateTo({
						url: '/subPackages/mine/orderDetails/orderDetails?orderId=' + id + '&shopType=' + this.shopType + '&isShopOrder=' + this.isShopOrder
					})
				}
				
			},
			deleBtn(){
				this.$emit('deleBtn')
			},
			payOk(){
				this.$emit('payOk')
			},
			deliveryOk(){
				this.$emit('deliveryOk')
			}
		}
	}
</script>

<style lang="scss">
	@import '@/common/css/myOrderList.scss';
</style>
